package com.lzl.springboot.mapper;

import com.lzl.springboot.bean.Employee;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

@Component
@Mapper
public interface EmployeeMapper {
    
    @Select("select * from employee")
    List<Employee> list();

    @Select("select * from employee where id=#{id}")
    Employee findOne(String id);

    @Options(useGeneratedKeys =true,keyProperty = "id")
    @Insert("insert into employee(id,name,age,sex)values(#{id},#{name},#{age},#{sex})")
    int save(Employee employee);

    Map findByXmla(String id);

    Employee findByXmlb(String id);
}
